package sireteste;

import java.io.IOException;
import sire.controller.BaseCadController;
import sire.manager.ManagerCreator;
import sireteste.dao.CaixoteDAO;
import sireteste.dao.CcDAO;
import sireteste.dao.OpbDAO;
import sireteste.vo.CaixoteVO;
import sireteste.vo.CcVO;
import sireteste.vo.OpbVO;

public class MainForm extends sire.ui.SireThinlet {

    public MainForm(String xmlUrl) throws IOException {
        super(xmlUrl);
        ManagerCreator.getInstance();
    }

    public void showCaixote(Object desktop) throws Exception {
        BaseCadController<CaixoteVO> calControl = new BaseCadController<CaixoteVO>(this, "xml/caixote.xml", FormType.MDI, new CaixoteDAO(), "grid");
        calControl.populateGrid();
        calControl.newer();
        this.addMDI(desktop, calControl, "Caixote");
    }

    public void showCc(Object desktop) throws Exception {
        BaseCadController<CcVO> calControl = new BaseCadController<CcVO>(this, "xml/cc.xml", FormType.MDI, new CcDAO(), "grid");
        calControl.populateGrid();
        calControl.newer();
        this.addMDI(desktop, calControl, "Conta Corrente");
    }

    public void showOp(Object desktop) throws Exception {
        BaseCadController<OpbVO> calControl = new BaseCadController<OpbVO>(this, "xml/op.xml", FormType.MDI, new OpbDAO(), "grid");
        calControl.newer();
        this.addMDI(desktop, calControl, "Opb");
    }

    public void sair() {
        System.exit(0);
    }
}
